package com.yhh.college_information_platform.constant;

/**
 * 通用常量类
 *
 * @author yhh
 * @date 2025-10-05
 */
public class CommonConstant {

    /**
     * 用户角色
     */
    public static final String ROLE_USER = "user";
    public static final String ROLE_ADMIN = "admin";

    /**
     * 用户状态
     */
    public static final Integer USER_STATUS_DISABLED = 0;
    public static final Integer USER_STATUS_ENABLED = 1;

    /**
     * 资料状态
     */
    public static final Integer RESOURCE_STATUS_PENDING = 0;  // 待审核
    public static final Integer RESOURCE_STATUS_APPROVED = 1; // 已通过
    public static final Integer RESOURCE_STATUS_REJECTED = 2; // 已拒绝
    public static final Integer RESOURCE_STATUS_OFFLINE = 3;  // 已下架

    /**
     * 分类层级
     */
    public static final Integer CATEGORY_LEVEL_ONE = 1;  // 一级分类
    public static final Integer CATEGORY_LEVEL_TWO = 2;  // 二级分类

    /**
     * 分类状态
     */
    public static final Integer CATEGORY_STATUS_DISABLED = 0; // 禁用
    public static final Integer CATEGORY_STATUS_ENABLED = 1;  // 启用

    /**
     * 评论状态
     */
    public static final Integer COMMENT_STATUS_DELETED = 0; // 已删除
    public static final Integer COMMENT_STATUS_NORMAL = 1;  // 正常

    /**
     * 父级ID
     */
    public static final Long PARENT_ID_ROOT = 0L;  // 顶级父ID

    /**
     * Redis Key 前缀
     */
    public static final String REDIS_KEY_USER_INFO = "user:info:";           // 用户信息
    public static final String REDIS_KEY_CATEGORY_TREE = "category:tree";    // 分类树
    public static final String REDIS_KEY_HOT_RESOURCE = "resource:hot";      // 热门资料
    public static final String REDIS_KEY_RESOURCE_VIEW = "resource:view:";   // 资料浏览记录

    /**
     * Token相关
     */
    public static final String TOKEN_HEADER = "Authorization";
    public static final String TOKEN_PREFIX = "Bearer ";

    /**
     * 默认分页参数
     */
    public static final Long DEFAULT_PAGE_NUM = 1L;
    public static final Long DEFAULT_PAGE_SIZE = 10L;
    public static final Long MAX_PAGE_SIZE = 100L;

    /**
     * 文件相关
     */
    public static final Long MAX_FILE_SIZE = 104857600L; // 100MB
}
